package string;

public class Test {
    public static void main(String[] args) {
        String name1 = getHostName("http://www.tedu.cn");
        String name2 = getHostName("doc.canglaoshi.org");
        String name3 = getHostName("www.tarena.com.cn");
        System.out.println(name1);//tedu
        System.out.println(name2);//canglaoshi
        System.out.println(name3);//tarena





//        String name = name1.substring(11,16);
//        System.out.println(name1);
//
//
//        name = name1.substring(9);










    }



        public static String getHostName(String location){
        int start=location.indexOf(".")+1;
        int end = location.indexOf(".",start);





            return location.substring(start,end);




        }
    }